package nl.haemers.collections.interfaces 
{
	import nl.haemers.collections.interfaces.ICollection;
	import nl.haemers.collections.interfaces.IIterable;
	import nl.haemers.collections.interfaces.IListIterator;
	import nl.haemers.collections.ListIterator;
	/**
	 * ...
	 * @author Jonathan Haemers
	 */
	public interface IList extends ICollection
	{
		/**
		 * Add object to the list at the specified index.
		 * Since we can't do overloading in AS3 we need to give the method a different name.
		 * @param	location
		 * @param	e
		 */
		function addAt(location:int, e:Object) : void;
		//function addAt(index:int, object:IIterable) : void;
		
		/**
		 * Add the objects to the list at the specified index.
		 * Since we can't do overloading in AS3 we need to give the method a different name.
		 * @param	location
		 * @param	collection
		 * @return  true if collection isn't empty else false.
		 */
		function addAllAt(location:int, collection:ICollection) : Boolean;
		
		/**
		 * Returns an object from the specified position in the list.
		 * @param	location
		 * @return
		 */
		function get(location:int) : Object;
		
		/**
		 * Returns the position of the object in the list.
		 * @param	e object
		 * @return
		 */
		function indexOf(e:Object) : int;
		
		/**
		 * Returns the index of the last occurrence of the specified object in this list, or -1 if this list does not contain the object.
		 * @param	e
		 * @return
		 */
		function lastIndexOf(e:Object) : int;
		
		/**
		 * Returns a list iterator of the objects in the list.
		 * @return
		 */
		function listIterator() : ListIterator;
		
		/**
		 *  Returns a list iterator of the objects in this list , starting at the specified position in this list.
		 * @param	location
		 * @return
		 */
		function listIteratorAt(location:int) : ListIterator;
		
		/**
		 * Remove the object at the specified position. And returns the removed object.
		 * Since we can't overload in AS3 we need to give the method another name.
		 * @param	location
		 * @return  Object
		 */
		function removeAt(location:int) : Object;
		
		/**
		 * Replaces the object at the specified position in this list with the specified object 
		 * @param	e
		 * @param	location
		 * @return
		 */
		function set(location:int, e:Object) : Object;
		
		/**
		 * Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
		 * @param	fromIndex
		 * @param	toIndex
		 * @return
		 */
		function subList(start:int, end:int) : IList;
          
	}
	
}